package com.zyf.school.manager.domain;

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 员工信息
 */
@Setter@Getter@ToString
@NoArgsConstructor
@AllArgsConstructor
@TableName("staff")
public class Staff implements Serializable {
    private String id;//员工编号：所属部门负责人电话+时间戳+随机数
    private String name;//员工姓名
    private int age;//年龄
    private int sex;//性别
    private String email;//邮箱
    private String dd;//钉钉号
    private String wx;//微信号
    private String tel;//手机号
    private String jobnum;//工号
    private String position;//职位
    private String level;//级别
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date begintime;//入职时间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endtime;//离职时间

    private String card;//编号

    public void setBegintime(Date begintime) {
        if(begintime==null){
            this.begintime = new Date();
        }else
            this.begintime = begintime;
    }
}
